package cn.yang.domain.activity.model.aggregate;

import cn.yang.domain.activity.model.entity.ActivityAccountEntity;
import cn.yang.domain.activity.model.entity.ActivityOrderEntity;
import cn.yang.domain.activity.model.valobj.OrderStateVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @version v1.0
 * @ClassName: cn.yang.domain.activity.model.aggregate
 * @Description: 下单聚合对象，保证事务，领域外保证事务的最终一致性
 * @Author: YJ
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CreateQuotaOrderAggregate {
    //活动账户实体
    private ActivityAccountEntity activityAccountEntity;

    //用户ID
    private String userId;
    //活动ID
    private Long activityId;
    //总次数
    private Integer totalCount;
    //日次数
    private Integer dayCount;
    //月次数
    private Integer monthCount;
    //活动订单实体
    private ActivityOrderEntity activityOrderEntity;

    public void setOrderState(OrderStateVO orderState) {
        this.activityOrderEntity.setState(orderState);
    }
}
